fix: restrict GITHUB_TOKEN to contents: read in sync workflow#10
Merged
nbrieussel merged 1 commit intomainfrom Apr 14, 2026
Merged
fix: restrict GITHUB_TOKEN to contents: read in sync workflow#10nbrieussel merged 1 commit intomainfrom
nbrieussel merged 1 commit intomainfrom
Conversation
The GITHUB_TOKEN previously inherited org-wide default permissions. Since the workflow only uses GitHub App credentials for the sync and GITHUB_TOKEN is only needed for the two actions/checkout steps, restrict it to contents: read. Closes #3
Author
Dry-run validationTriggered a manual dry-run on this branch before opening PR #11: Run: https://github.com/IntegratedDynamic/admin/actions/runs/24372508236 Results
Conclusion: this PR only adds Note: PR #11 automates this gate so future PRs get this check automatically. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
permissions: contents: readto thesyncjob in the Safe Settings sync workflowGITHUB_TOKENto the minimum required scope — it is only used by the twoactions/checkoutsteps, socontents: readis sufficientAPP_ID+PRIVATE_KEY), notGITHUB_TOKENWhy
Without an explicit
permissions:block,GITHUB_TOKENinherits the org-wide default permissions, which may include write access across many scopes. This is unnecessarily broad for a workflow that does not need it.Note on dry-run
This is a workflow infrastructure change (not a safe-settings config change), so no safe-settings dry-run is required. The workflow will be validated by GitHub Actions on the next push to
main.Closes #3